Skip to Content
Welcome to my more educational website. Head back to more fun stuff here!

Factoring Matrices

May 2023


Singular Value Decomposition (SVD)

Let AA be an m×nm \times n matrix. The Singular Value Decomposition (SVD) is

A=UΣVTA = U \Sigma V^T

Where:

  • UU is m×mm \times m orthogonal with columns as unit eigenvectors of AATAA^T.
  • VV is n×nn \times n orthogonal with columns as unit eigenvectors of ATAA^TA.
  • Σ\Sigma is m×nm \times n diagonal with singular values.

SVD Example

Let

A=[5517]A = \begin{bmatrix} 5 & 5 \\ -1 & 7 \end{bmatrix}

Compute VV:

ATA=[26181874],λ=20,80A^TA = \begin{bmatrix} 26 & 18 \\ 18 & 74 \end{bmatrix}, \quad \lambda = 20, 80

Unit eigenvectors:

V1=110[31],V2=110[13]V_1 = \frac{1}{\sqrt{10}} \begin{bmatrix}-3 \\ 1\end{bmatrix}, \quad V_2 = \frac{1}{\sqrt{10}} \begin{bmatrix}1 \\ 3\end{bmatrix}

Combine into

V=110[3113],Σ=[250045]V = \frac{1}{\sqrt{10}} \begin{bmatrix}-3 & 1 \\ 1 & 3\end{bmatrix}, \quad \Sigma = \begin{bmatrix} 2\sqrt{5} & 0 \\ 0 & 4\sqrt{5} \end{bmatrix}

Then UU satisfies AV=UΣAV = U\Sigma:

U=12[1111]U = \frac{1}{\sqrt{2}} \begin{bmatrix}1 & 1 \\ -1 & 1\end{bmatrix}

QR Decomposition

For a m×nm \times n linearly independent matrix AA:

A=QRA = QR
  • QQ orthogonal (orthonormal columns)
  • RR upper triangular

Compute QQ via Gram-Schmidt:

nk=vki=1k1vknini2ni,qk=nknkn_k = v_k - \sum_{i=1}^{k-1} \frac{v_k \cdot n_i}{\|n_i\|^2} n_i, \quad q_k = \frac{n_k}{\|n_k\|}

Example:

A=[232411],Q=13[212212],R=[3501]A = \begin{bmatrix} 2 & 3 \\ 2 & 4 \\ 1 & 1 \end{bmatrix}, \quad Q = \frac{1}{3} \begin{bmatrix} 2 & -1 \\ 2 & 2 \\ 1 & -2 \end{bmatrix}, \quad R = \begin{bmatrix}3 & 5 \\ 0 & 1\end{bmatrix}

LU Decomposition

For square AA:

A=LUA = LU
  • LL lower triangular, UU upper triangular
  • Augment II and row reduce to get LL and UU.

Cholesky Decomposition

For symmetric positive definite AA:

A=LLTA = LL^T

Entries of LL:

Lii=Aiik=1i1Lik2,Lij=1Ljj(Aijk=1j1LikLjk), i>jL_{ii} = \sqrt{A_{ii} - \sum_{k=1}^{i-1} L_{ik}^2}, \quad L_{ij} = \frac{1}{L_{jj}} \left( A_{ij} - \sum_{k=1}^{j-1} L_{ik} L_{jk} \right), \ i>j
Last updated on